package com.cy.sentinel;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

@Component
public class DefaultRequestOriginParser implements RequestOriginParser {
    @Override
    public String parseOrigin(HttpServletRequest Request) {
        return Request.getParameter("Origin");
//        String addr = Request.getRemoteAddr();
//
//        int port = Request.getLocalPort();
//        System.out.println("port="+port);
//        System.out.println("addr="+addr);
//        return addr;
    }
}
